import { createStore } from 'vuex'

export default createStore({
    state: {
        user:null,
        loading: false,
        isEdit:false,
        scrollNum:0,
    },
    mutations: {
        SET_LOADING: (state, v) => {
            state.loading = v;
        },
        SET_USER: (state, v) => {
            state.user = v;
        },
        SET_EDIT: (state, v) => {
            state.isEdit = v;
        },
    },
    actions: {
        setLoading: ({commit}, v) => {
            commit('SET_LOADING', v);
        },
        setUser: ({commit}, v) => {
            commit('SET_USER', v);
        },
        setEdit: ({commit}, v) => {
            commit('SET_EDIT', v);
        },
    },
    modules: {

    }
})